package com.lifa.controller;

import com.lifa.entity.Taocantuixujilu;
import com.lifa.service.TaoCanTuiXuJiLuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/taocantuixujilu")
@Scope("prototype")
public class TaoCanTuiXuJiLuController {
    @Autowired
    private TaoCanTuiXuJiLuService taoCanTuiXuJiLuService;

    @RequestMapping("/tuifeichax1")
    @ResponseBody
    public List<Taocantuixujilu> tuifeichax1(){
        return taoCanTuiXuJiLuService.tuifeichax1();
    }

    @RequestMapping("/tuifeifenye1")
    @ResponseBody
    public Map<String,Object> tuifeifenye1(String username,int offset,int limit){
        Map<String,Object> map=new HashMap<>();
        map.put("rows",taoCanTuiXuJiLuService.tuifeifenye1(username,offset,limit));
        map.put("total",taoCanTuiXuJiLuService.tuifeizongtiaoshu1(username));
        return map;
    }

    }
